home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / tjgold.zip / INSTALL.003 / DEMDESK2.PAS < prev    next >
Pascal/Delphi Source File  |  1995-05-29  |  3KB  |  94 lines

  1. {--------------------------------------------------------------------------}
  2. {                Product: TechnoJock's Turbo Toolkit GOLD                  }
  3. {                                                                          }
  4. {                     TTT GOLD - DEMO PROGRAM                        }
  5. {                                                                          }
  6. {              Copyright 1986-1995  TechnoJock Software, Inc.              }
  7. {                           All Rights Reserved                            }
  8. {                          Restricted by License                           }
  9. {--------------------------------------------------------------------------}
  10.  
  11. {Description:  DEMDESK2.PAS
  12.                Creates a desktop with a calculator
  13.                and calendar.
  14. }
  15.  
  16. program DEMDESK2;
  17.  
  18. uses DOS, CRT,
  19.      GoldFast, GoldWin, GoldMenu, GoldMisc, GoldDesk,
  20.      GoldKey, GoldCalc, GoldCal, GoldDate;
  21.  
  22. var
  23.    MainMenu: Bar;
  24.    SubMenu: PopUp;
  25.    Action : dAction;
  26.  
  27. procedure DefineSubMenu;
  28. {}
  29. begin
  30.    InitPopUp(SubMenu);
  31.    with SubMenu do
  32.    begin
  33.       PopUpAddItem(SubMenu,'~C~alculator',101,67,'Display a calculator',nil);
  34.       PopUpAddItem(SubMenu,'Ca~l~endar',102,76,'Display a calendar',nil);
  35.       PopUpAddItem(SubMenu,'~A~bout',103,65,'Show version and copyright information',nil);
  36.       PopUpAddItem(SubMenu,'E~x~it',999,88,'~Exit~ this little demo',nil);
  37.    end;
  38. end; { DefineSubMenu }
  39.  
  40. procedure DefineMainMenu;
  41. {}
  42. begin
  43.    InitBar(MainMenu);
  44.    BarAddItem(MainMenu,'~T~ools',100,84,276,'Select one of Desktop tools',@SubMenu);
  45.    BarAddHK(MainMenu,301,999); {Alt-X}
  46.    MainMenu.Style := 2;
  47. end; { DefineMainMenu }
  48.  
  49. procedure DisposeMenus;
  50. {}
  51. begin
  52.    DestroyBar(MainMenu);
  53.    DestroyPopUp(SubMenu);
  54. end; { DisposeMenus }
  55.  
  56. {$F+}
  57. procedure MyActionProc(Choice:integer;var Action:DAction);
  58. {}
  59. begin
  60.    case Choice of
  61.      101: if LaunchCalculator(' Punch Me ') = 0 then
  62.         PromptOK(' Error ', 'Unable to display the Calculator');
  63.      102: if LaunchCalendar(TodayInJul,' Calendar ') = 0 then
  64.         PromptOK(' Error ', 'Unable to display the Calendar');
  65.      103: PromptOK(' Tools Demo ','^Copyright 1995 TechnoJock Software, Inc.|'+
  66.                      '^All Rights Reserved');
  67.      999: Action := DFinished;
  68.    end;
  69. end; { MyActionProc }
  70. {$F-}
  71.  
  72. begin
  73. {$IFOPT D+}
  74.    HeapRecord;
  75. {$ENDIF}
  76.    DefineSubMenu;
  77.    DefineMainMenu;
  78.    DeskAssignMainMenu(MainMenu);
  79.    DeskAssignActionProc(MyActionProc);
  80.    (*
  81.    UseCustomChars;
  82.    *)
  83.    SetBlinking(false);
  84.    MouseShow(true);
  85.    CursorOff;
  86.    Action := DeskProcessInput;
  87.    CursorOn;
  88.    MouseShow(false);
  89.    DisposeMenus;
  90. {$IFOPT D+}
  91.    HeapCheck;
  92. {$ENDIF}
  93. end.
  94.